package top.jsjkxyjs.blackbox.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import top.jsjkxyjs.blackbox.service.CarService;
import top.jsjkxyjs.blackbox.service.CarTypeService;
import top.jsjkxyjs.blackbox.utils.Msg;


@Controller
@RequestMapping("/data")
public class IotController {
	@Autowired
	CarService carService;
	@Autowired
	CarTypeService carTypeService;

	@PostMapping("/findCarType")
	@ResponseBody
	public Msg findCarType(int CarId) {
		String carType = carTypeService.getCarTypeByCarId(CarId);
		if (!"".equals(carType)) {
			return Msg.success(carType);
		} else {
			return Msg.tips("暂时未查询到此车辆信息哦！", 400);
		}
	}
}
